package com.example.perpetualcalendar.base;

import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
import android.view.WindowManager;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;


/**
 * @author langhua
 */
public abstract class BaseActivity<VM extends ViewModel> extends AppCompatActivity {

    public VM mViewModel;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mViewModel = new ViewModelProvider(this).get(setViewModel());

    }

    /**
     * get ViewModel
     * @return 一个继承至 @see{@link ViewModel }的类
     */
    @NonNull
    protected abstract Class<VM> setViewModel();

    @Override
    protected void onDestroy() {
        super.onDestroy();

    }
}
